package com.ctshk.common.enums;

import lombok.Data;

/**
 * <p>
 *  登录类型
 * </p>
 *
 * @author 李新科
 * @date 2021/6/3 14:53
 */
public enum LoginType {

    APP(1, "app"),
    PC(2, "pc");

    private Integer code;
    private String msg;

    LoginType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMsgByCode(Integer code){
        for (LoginType type : LoginType.values()) {
            if (type.code.equals(code)) {
                return type.getMsg();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
